package com.zrt.pad.datasource.bean;

import java.io.Serializable;
import java.math.BigDecimal;

import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;

public class GridShowItem implements Parcelable, Serializable{

	public String pluid;
	public String plucode;
	public String pluname;
	public String unit;
	public BigDecimal pfcount;
	public BigDecimal pfprice;
	public String plutype;
	
	public static final Parcelable.Creator<GridShowItem> CREATOR = new Creator<GridShowItem>() {
		@Override
		public GridShowItem[] newArray(int size) {
			return new GridShowItem[size];
		}
		
		@Override
		public GridShowItem createFromParcel(Parcel source) {
			GridShowItem item = new GridShowItem();
			item.pluid = source.readString();
			item.plucode = source.readString();
			item.pluname = source.readString();
			item.unit = source.readString();
			item.pfcount = new BigDecimal(source.readString());
			item.pfprice = new BigDecimal(source.readString());
			item.plutype = source.readString();
			return item;
		}
	 };
	 
	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		// TODO Auto-generated method stub
		dest.writeString(pluid);
		dest.writeString(plucode);
		dest.writeString(pluname);
		dest.writeString(unit);
		dest.writeString(pfcount.toString());
		dest.writeString(pfprice.toString());
		dest.writeString(plutype);
	}

	@Override
	public boolean equals(Object o) {
		if (o instanceof GridItem) {
			GridItem boi = (GridItem) o;
			return pluid.equals(boi.pluid);
		}
		return false;
	}
}
